package cn.cheln.explorer.actions.sort;

import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.support.log.Logs;
import java.util.Comparator;
import java.util.Date;

public class ObjectSort
  implements Comparator<FileInfo>, Sort
{
  public int policy = -1;
  public int seq = -1;

  public ObjectSort(int paramInt1, int paramInt2)
  {
    this.policy = paramInt1;
    this.seq = paramInt2;
  }

  public int compare(FileInfo paramFileInfo1, FileInfo paramFileInfo2)
  {
    int i = 1;
    initFile(paramFileInfo1);
    initFile(paramFileInfo2);
    if ((paramFileInfo1.getIsDir().booleanValue()) && (!(paramFileInfo2.getIsDir().booleanValue())))
      i = -1;
    do
      return i;
    while ((!(paramFileInfo1.getIsDir().booleanValue())) && (paramFileInfo2.getIsDir().booleanValue()));
    int j = this.policy;
    int k = 0;
    switch (j)
    {
    default:
      label96: if (this.seq != i)
        break label285;
    case 2:
    case 1:
    case 0:
    case 3:
    }
    while (true)
    {
      return k;
      k = (int)(paramFileInfo2.getLeng().longValue() - paramFileInfo1.getLeng().longValue());
      break label96:
      if (paramFileInfo1.unformattedDate == null)
        paramFileInfo1.unformattedDate = new Date(paramFileInfo1.getLastModifiedInt().longValue());
      if (paramFileInfo2.unformattedDate == null)
        paramFileInfo2.unformattedDate = new Date(paramFileInfo2.getLastModifiedInt().longValue());
      if (paramFileInfo1.unformattedDate.after(paramFileInfo2.unformattedDate))
        k = -1;
      if (paramFileInfo1.unformattedDate.before(paramFileInfo2.unformattedDate))
        k = 1;
      boolean bool = paramFileInfo1.unformattedDate.equals(paramFileInfo2.unformattedDate);
      k = 0;
      if (bool);
      k = 0;
      break label96:
      paramFileInfo2.buildName();
      paramFileInfo1.buildName();
      k = paramFileInfo2.getName().compareToIgnoreCase(paramFileInfo1.getName());
      break label96:
      k = paramFileInfo2.getType().compareToIgnoreCase(paramFileInfo1.getType());
      break label96:
      label285: k = -k;
    }
  }

  public Object getContent()
  {
    return this;
  }

  public int getPolicy()
  {
    return this.policy;
  }

  public int getSeq()
  {
    return this.seq;
  }

  public void initFile(FileInfo paramFileInfo)
    throws NumberFormatException
  {
    if (paramFileInfo.isFileBuilt)
      return;
    paramFileInfo.buildFile();
  }

  public void setPolicy(int paramInt)
  {
    if (paramInt == -1)
      return;
    Logs.i("---- policy " + paramInt);
    this.policy = paramInt;
  }

  public void setSeq(int paramInt)
  {
    if (paramInt == -1)
      return;
    this.seq = paramInt;
  }

  public Sort transfer(String paramString)
  {
    if ((paramString == null) || (paramString.startsWith("image")) || (paramString.startsWith("audio")) || (paramString.startsWith("video")) || (paramString.startsWith("apk")) || (paramString.startsWith("doc")) || (paramString.startsWith("lewa/theme")))
      this = new DBSort(this.policy, this.seq);
    return this;
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.actions.sort.ObjectSort
 * JD-Core Version:    0.5.2
 */